Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CIBA #473

Merged
merged 7 commits into from
Jan 8, 2025
Merged

Support for CIBA #473

merged 7 commits into from
Jan 8, 2025

Conversation

duedares-rvj
Copy link
Contributor

@duedares-rvj duedares-rvj commented Dec 9, 2024

The backchannel login endpoint enables applications to send an authentication request to a user’s phone (provided they have an app installed and have enrolled for Push Notification authentication using the Guardian SDK). It can be useful to authenticate users who are not physically present, such as users phoning a call center, or where the device being used does not have a screen, such as a shared bicycle or scooter.

resp, err := authAPI.CIBA.Initiate(context.Background(), ciba.Request{
		ClientID:     mgmtClientID,
		ClientSecret: mgmtClientSecret,
		Scope:        "openid",
		LoginHint: map[string]string{
			"format": "iss_sub",
			"iss":    "your-issuer-domain",
			"sub":    "auth0|user-id-here",
		},
		BindingMessage: "TEST-BINDING-MESSAGE",
	})

token, err := authAPI.OAuth.LoginWithGrant(context.Background(),
			"urn:openid:params:grant-type:ciba",
			url.Values{
				"auth_req_id":   []string{resp.AuthReqID},
				"client_id":     []string{clientID},
				"client_secret": []string{clientSecret},
			},
			oauth.IDTokenValidationOptions{})

🔧 Changes

  1. Add CIBA as a new authentication type.
  2. Configure the new endpoint request/response obejcts.
  3. Add required test cases.

📚 References

🔬 Testing

Relevant test cases has been added and can be tested using:
make test-record FILTER=TestCIBA

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@duedares-rvj duedares-rvj self-assigned this Dec 9, 2024
@duedares-rvj duedares-rvj requested a review from a team as a code owner December 9, 2024 05:25
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 73.68421% with 10 lines in your changes missing coverage. Please review.

Project coverage is 95.31%. Comparing base (6452713) to head (1519663).

Files with missing lines Patch % Lines
authentication/ciba.go 72.97% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
- Coverage   95.39%   95.31%   -0.08%     
==========================================
  Files          52       53       +1     
  Lines       10502    10540      +38     
==========================================
+ Hits        10018    10046      +28     
- Misses        366      373       +7     
- Partials      118      121       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@developerkunal developerkunal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@duedares-rvj duedares-rvj merged commit 0090965 into main Jan 8, 2025
7 checks passed
@duedares-rvj duedares-rvj deleted the SDK-5225/CIBA branch January 8, 2025 07:53
@developerkunal developerkunal mentioned this pull request Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants